///////////////////////////////////////////////////////////////////////////
//																		 //
//	Author:		Michael Mozdzierz										 //
//	Date:		10/22/2014												 //
//	Purpose:	Make a class that loads, stores and maintains all		 //
//				settings in the game									 //
//																		 //
///////////////////////////////////////////////////////////////////////////

#ifndef _SETTINGS_MANAGER_H
#define _SETTINGS_MANAGER_H

#include <vector>
#include <string>

using namespace std;

// Structure that holds a single setting for the game
struct Setting
{
	string name;
	union
	{
		char _char[16];
		int _int;
		float _float;
	};

	Setting(const char* name, const char* _char, int num_characters)
	{
		this->name = name;
		memset((void*)_char, 0, 16);
		memcpy(this->_char, _char, num_characters);
	}
	Setting(const char* name, int value)
	{
		this->name = name;
		_int = value;
	}
	Setting(const char* name, float value)
	{
		this->name = name;
		_float = value;
	}
};

// Manager class for all object in the game
class SettingsManager
{
	vector<Setting> settings;
	
	SettingsManager(void);
	~SettingsManager(void);
public:
	/////////////////////<mutators>//////////////////////////////////////////
	void setSetting(const char* name, Setting* value);

	/////////////////////<accessors>//////////////////////////////////////////

	static SettingsManager* GetInstance(void);

	Setting getSetting(const char* name) const;
};

#endif